package com.example.oj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.oj.entity.Submit;
import com.example.oj.entity.dto.submit.SubmitAddRequest;
import com.example.oj.entity.dto.submit.SubmitQueryRequest;
import com.example.oj.entity.vo.SubmitVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @description submit(题目提交) Service
 * @createDate 2023-10-26 09:30:28
 */
public interface SubmitService extends IService<Submit> {

  /**
   * 提交题目,题目提交之后交给代码沙箱
   */
  public void doSubmitQuestion(SubmitAddRequest submitAddRequest,HttpServletRequest request);

  /**
   * 获取题目封装
   */
  SubmitVO getSubmitVO(Submit submit);

  /**
   * 分页获取题目封装
   * @param submitPage
   * @return
   */
  Page<SubmitVO> getSubmitVOPage(Page<Submit> submitPage);

  /**
   * 获取题目提交 分页数据
   */
  Page<SubmitVO> listPageQuestionVO(SubmitQueryRequest submitQueryRequest);

  void updateStateById(Long id);
}
